package test;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class InputScore {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double cj;
        double student[] = new double[15];
        for (int i = 0; i < student.length; i++) {
            while (true) {
                System.out.print("请输入第" + (i + 1) + "名同学的成绩:");
                cj = in.nextDouble();
                if (cj >= 0 && cj <= 100) {
                    student[i]=cj;//把cj赋值给student[i]
                    break;
                }
                System.out.println("输入错误,请重新输入!");

            }
        }
        for (int i = 0; i < student.length; i++) {
            System.out.println("15名同学的成绩" + student[i]);

        }

    }
}
